
<div ng-form="ng-form" role="form" name="projectNameForm" novalidate="novalidate" ng-class="{'need-valid':needValid}" class="mod-project project-create1">
  <loading ng-if="isLoading"></loading>
  <div class="pro-item com-chose-repository"><span class="opt-title">选择代码仓库</span><span ng-click="toggleCodeManager('gitlab')" ng-class="{active:codeManager=='gitlab'}" class="repository"><i class="icon-gitlab"></i>GitLab</span><span ng-click="toggleCodeManager(null)" ng-class="{active:!codeManager}" class="repository nohub">不使用代码仓库</span>
  </div>
  <div ng-show="codeManager" class="chose-account">
    <input placeholder="请输入项目名称查询" ng-model="pronameKey" class="pull-right ui-input-search ui-input-fill"/>
    <ul list-scroll="list-scroll" width-offset="740">
      <li disabled="true" class="nav-option"><span><a class="icon-last to-last"></a><a class="icon-next to-next"></a></span></li>
      <li ng-repeat="user in gitLabInfo" ng-class="{'active':currentUserId===user.id}"><a ng-bind="user.userName" ng-click="setProjectList(user)" class="link-list"></a></li>
    </ul><span class="related"><a ng-click="toRelated()"><i class="icon-add-green"></i>关联新账户</a></span>
  </div>
  <ul ng-show="codeManager" class="list-project">
    <li ng-if="!projectListFilter||projectListFilter.length===0"><span class="no-result">无项目信息</span></li>
    <li ng-repeat="pro in projectListFilter=(projectList|filter:{'nameWithNamespace':pronameKey}|listPage:pageSize:pageNo)" ng-click="setCurrentProject(pro)" ng-class="{'active':currentProject.projectId===pro.projectId}"><span ng-cloak="ng-cloak" class="project-name"><i ng-if="currentProject.projectId===pro.projectId" class="icon-check"></i>{{pro.nameWithNamespace}}</span><span ng-bind="isDescriptionNull(pro.description)" class="project-description"></span></li>
  </ul>
  <div list-no="list-no" length="projectList.length" pageno="pageNo" size="{{pageSize}}" ng-show="codeManager" class="com-page-list"></div>
  <div ng-show="codeManager" class="pro-item branch-setting"><span class="opt-title">自动构建</span>
    <div class="opt-content">
      <p class="txt-prompt opt-descrip"> 当所选分支更新或出现新tag时，会自动触发构建，生成新的项目镜像。请不要在频繁push的分支上开启自动构建，以免频繁触发构建，造成资源浪费。</p><span class="branch">
        <input id="master" type="checkbox" name="branches" ng-model="autoBuildInfo.master" class="ui-check"/>
        <label for="master">master</label></span><span class="branch">
        <input id="tag" type="checkbox" name="branches" ng-true-value="1" ng-false-value="0" ng-model="autoBuildInfo.tag" class="ui-check"/>
        <label for="tag">tag</label></span><span class="branch">
        <input id="other" type="checkbox" name="branches" ng-model="autoBuildInfo.other" class="ui-check"/>
        <label for="other" ng-if="!autoBuildInfo.other">指定其他分支</label>
        <label for="other" ng-if="autoBuildInfo.other"></label>
        <input placeholder="请输入分支名称，用逗号分隔 e.g. dev,fix-bug" ng-if="autoBuildInfo.other" ng-model="autoBuildInfo.branches" name="other" required="required" class="ui-input-white txt-branch"/></span>
    </div>
  </div>
  <div class="pro-item"><span class="opt-title">项目构建类型</span>
    <div class="opt-content">
      <p class="txt-prompt opt-descrip">项目需要构建成Docker镜像，才能被部署到运行环境中。项目构建过程包含了代码编译、docker build等操作。您可以选择一种项目构建类型，并完成相应配置。</p><span ng-class="{'active':projectType=='common'}" ng-click="projectType = 'common'" class="setting-type">
        <h4>通用配置</h4>
        <p>适合各种编程语言的项目，在页面上配置Dockerfile以及运行过程的相关信息。</p></span><span ng-class="{'active':projectType=='custom'}" ng-click="projectType = 'custom'" ng-show="codeManager" class="setting-type">
        <h4>Java专属配置</h4>
        <p>专为Java项目打造，分离编译和构建过程，精简项目镜像。</p></span><span ng-class="{'active':projectType=='dockerfile'}" ng-click="projectType = 'dockerfile'" ng-show="codeManager" class="setting-type">
        <h4>代码内Dockerfile</h4>
        <p>使用代码项目内的Dockerfile。请确保构建所用的代码分支或tag中存在可用的Dockerfile。</p></span>
    </div>
  </div>
  <div class="pro-item"><span class="opt-title">创建者</span>
    <creator-selection default-user-id="creator.id" default-user-type="{{creator.type}}" change-event="changeCreator(user)"></creator-selection>
  </div>
  <div class="pro-item project-info"><span class="opt-title">项目名称 *</span>
    <div class="creator-info"><span ng-bind="creator.name" class="creator-name"></span>/
      <input placeholder="输入项目名称" is-project-exist="is-project-exist" group-name="{{creator.name}}" name="proname" ng-pattern="/^[a-z0-9]+([._-][a-z0-9]+)*$/" ng-model="projectName" ng-model-options="{updateOn:'default blur',debounce:{default:500,blur:0}}" required="required" class="ui-input-white"/>
    </div><span ng-if="(needValid||projectNameForm.proname.$dirty)&amp;&amp;projectNameForm.proname.$error.required" class="tool-inline-error">必填</span><span ng-if="(needValid||projectNameForm.proname.$dirty)&amp;&amp;!projectNameForm.proname.$error.required&amp;&amp;projectNameForm.proname.$error.isProjectExist" class="tool-inline-error">项目已存在</span><span ng-if="(needValid||projectNameForm.proname.$dirty)&amp;&amp;!projectNameForm.proname.$error.required&amp;&amp;projectNameForm.proname.$error.pattern" class="tool-inline-error">非法的名称</span>
  </div>
  <div class="com-bottom-option">
    <button ng-click="needValid=true;projectNameForm.$valid&amp;&amp;toNext()" class="ui-btn ui-btn-bright ui-btn-md">下一步</button>
  </div>
</div>
<script type="text/ng-template" id="loginModal.html">
  <div class="d-modal-header">登录Gitlab</div>
  <ul ng-form="ng-form" role="form" name="loginForm" class="modal-body modal-info modal-gitlab">
    <li>
      <label for="username" class="info-name">用户名</label>
      <div class="info-txt text-left">
        <input id="username" placeholder="用户名" name="username" ng-model="username" required="required" class="full ui-input-white"/><span ng-show="loginForm.username.$dirty&amp;&amp;loginForm.username.$invalid" class="txt-error">必填</span>
      </div>
    </li>
    <li>
      <label for="password" class="info-name">密码</label>
      <div class="info-txt text-left">
        <input id="password" placeholder="密码" name="password" type="password" ng-model="password" required="required" class="full ui-input-white"/><span ng-show="loginForm.password.$dirty&amp;&amp;loginForm.password.$invalid" class="txt-error">必填</span>
      </div>
    </li>
    <div ng-bind="errorTxt" class="txt-error txt-failed"></div>
  </ul>
  <div class="modal-footer text-right">
    <button ng-click="close()" class="ui-btn ui-btn-sm ui-btn-white">取消</button>
    <button ng-disabled="loginForm.$invalid||isWaiting" ng-click="toLogin()" class="ui-btn ui-btn-sm ui-btn-bright">确定</button>
  </div>
</script>